package com.gxa.modules.app.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.gxa.common.utils.Result;
import com.gxa.modules.app.service.BuyService;
import com.gxa.modules.sys.dto.CouponAddDto;
import com.gxa.modules.sys.dto.PurchaseAddDto;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@Api("卡卷购买")
@RestController
public class BuyController {

    @Autowired
    private BuyService buyService;

    @PostMapping("/buy/add")
    public Result addBuy(PurchaseAddDto purchaseAddDto){

        try {

            this.buyService.addBuy(purchaseAddDto);
            return new Result().ok();
        }catch (Exception e){
            e.printStackTrace();
            return new Result().error();
        }
    }
}
